package com.peanut.baby.mvp.qadetail;

import android.app.Activity;

import com.peanut.baby.model.QA;
import com.peanut.baby.model.QAComment;
import com.peanut.baby.model.QaRel;
import com.peanut.baby.model.UploadConf;
import com.peanut.baby.mvp.BasePresenter;
import com.peanut.baby.mvp.BaseView;

import java.util.List;

/**
 * Created by anonymouslystudio on 2017/7/27.
 */

public interface QADetailContract {
    interface View extends BaseView{
        void onAudioUploadFinished(boolean success, String failReason, UploadConf conf);
        void onRequestFailed(String code, String reason);
        void onSendCommentFinished(boolean success, String failReason, QAComment resultObj);
        void onGetCommentFinished(boolean success, String failReason, List<QAComment> resultObj);
        void onGetQADetailFinished(boolean success, String failReason, QA resultObj);
        void onSendAnswerFinished(boolean success, String failReason, QA resultObj);
        void onAudioPermissionGranted();
        void onAudioPermissionDenied();
        void onAnswerVoiceGet(String url);
        void onPraiseSuccess(QA qa);
        void onSharePointSuccess(String tips);
        void onQARelGet(boolean success, QaRel qaRel, String failReason);
    }
    interface Presenter extends BasePresenter{
        void sendComment(String text, String questionId);
        void sendAnswer(String voiceUrl, long duration, String questionId);
        void getCommentList(String id, int pageNo, int pageSize);
        void getQADetail(String id);
        void uploadCommentVoice(String path, int duration);
        void checkAudioPermission(Activity act);
        void getQAAnswerVoice(String id);
        void praiseQA(String questionId);
        void sharePoint(String questionId);
        void getQARel(int id);
    }
}
